<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
    <%--常量--%>
    <%@ include file="/common/constHead.jsp"%>
    <%--jQuery--%>
    <%@ include file="/common/jqueryHead.jsp"%>
    <%--jo--%>
    <%@ include file="/common/joHead.jsp"%>
    <%--bootstrap和字体--%>
    <%@ include file="/common/bootstrapHead.jsp"%>
    <%--layer--%>
    <%@ include file="/common/layerHead.jsp"%>
    <%--公共--%>
    <%@ include file="/common/commonHead.jsp"%>
    <%--日期选择--%>
    <%@ include file="/common/dateHead.jsp"%>
    <title>项目表单</title>
        <script type="text/javascript">
            $(function(){
                var jParams = {
                    "PKName" : "id",//主键属性名
                    "saveAfter" : "toEdit",
                    "addUrl" : "business/project/insert.action",//新增
                    "deleteUrl" : "business/project/delete.action",//删除
                    "updateUrl" : "business/project/update.action",//修改
                    "formDataUrl" : "business/project/getProject.action"	//查询
                };
                joForm.initFormPage(jParams);//初始化
            });
            //初始化表单值前处理
            joForm.initFormValueBefore = function(oJson){
                oJson.endTime = jo.formatDate(oJson.endTime);
                oJson.finishTime = jo.formatDate(oJson.finishTime);
                oJson.createTime = jo.formatDate(oJson.createTime);
                oJson.updateTime = jo.formatDate(oJson.updateTime);
            };
            joForm.initFormValueAfter = function(){
                if(joForm.formData.attachment){
                    //$("#attachment").html('<div><a class="cursor-hand" style="display: inline;" onclick="downloadFile(\''+joForm.formData.attachment+'\')">'+joForm.formData.attachment+'</a></div>');
                    var arr = joForm.formData.attachment.split(",");
                    for(var n=0;n<arr.length;n++){
                        jo.postAjax("{URL_FS}fs/fileInfo/getFileInfoList", {"id":arr[n]}, function(json){
                            if(json && json.code == 0 && json.data){
                                for(var i=0;i<json.data.length;i++){
                                    var item = json.data[i];
                                    $("#attachment").append('<div style="line-height: 1.7;"><a class="cursor-hand" style="display: inline;" onclick="downloadFile(\''+item.id+'\')">'+item.name+'</a></div>');
                                }
                            }
                        }, true);
                    }

                }
            }
        </script>
</head>
<body class="">
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
            <%--按钮栏--%>
            <div class="form-group button-bar">
                <button type="button" isShow="joForm.isAdd" class="btn btn-sm btn-outline btn-primary" onclick="joForm.save()">
                    <i class="fa fa-plus-circle" aria-hidden="true"></i>&nbsp;新增
                </button>
                <button type="button" isShow="!joForm.isAdd" class="btn btn-sm btn-outline btn-primary" onclick="joForm.update()">
                    <i class="fa fa-pencil-square" aria-hidden="true"></i>&nbsp;修改
                </button>
                <button type="button" isShow="!joForm.isAdd" class="btn btn-sm btn-outline btn-danger" onclick="joForm.del()">
                    <i class="fa fa-trash" aria-hidden="true"></i>&nbsp;删除
                </button>
            </div>
            <%--按钮栏--%>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-lg-12 col-md-12 col-sm-12">
            <form id="pageForm" name="pageForm" action="" method="post">
                <table class="table table-bordered  table-condensed dataTables-example dataTable no-footer">
                    <tr>

                        <td width="15%" width="15%" class="active" align="">项目名称</td>
                        <td width="85%" class="tnt">
                            <input type="text"  name="name" class="form-control input-sm" />
                            <input type="hidden"  name="id" class="form-control input-sm readonly-edit" />
                        </td>
                    </tr>
                    <tr>
                       
                        <td width="15%" class="active" align="">说　　明</td>
                        <td class="tnt">
                            <textarea  name="remark" class="form-control input-sm" ></textarea>
                        </td>
                    </tr>
                    <tr>

                        <td width="15%" class="active" align="">价　　格</td>
                        <td class="tnt">
                            <input type="text"  name="price" class="form-control input-sm" />
                        </td>
                    </tr>
                    <tr>
                        <td width="15%" class="active" align="">截止时间</td>
                        <td class="tnt">
                            <input type="text" onclick="laydate()" name="endTime" class="form-control input-sm" />
                        </td>
                    </tr>

                    <tr>
                        <td width="15%" class="active" align="">完成时间</td>
                        <td class="tnt">
                            <input type="text" onclick="laydate()" name="finishTime" class="form-control input-sm" />
                        </td>
                    </tr>
                    <tr>

                        <td width="15%" class="active" align="">登记时间</td>
                        <td class="tnt">
                            <input type="text" readonly name="createTime" class="form-control input-sm" />
                        </td>
                    </tr>
                    <tr>
                        <td width="15%" class="active" align="">客户姓名</td>
                        <td class="tnt">
                            <input type="text" name="person" class="form-control input-sm" />
                        </td>
                    </tr>
                    <tr>
                        <td width="15%" class="active" align="">项目年份</td>
                        <td class="tnt">
                            <select name="makeYear" class="form-control input-sm">
                                <option value=""></option>
                                <option value="2018">2018</option>
                                <option value="2017">2017</option>
                                <option value="2016">2016</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="active" align="">附件信息</td>
                        <td class="tnt" id="attachment">
                            <%--<input type="text"  name="attachment" class="form-control input-sm" />--%>
                        </td>
                    </tr>
                   <%-- <tr>
                        <td class="active" align="">修改时间</td>
                        <td class="tnt">
                            <input type="text" onclick="laydate()" name="updateTime" class="form-control input-sm" />
                        </td>
                        <td class="active" align="">创 建 人</td>
                        <td class="tnt">
                            <input type="text"  name="createUserId" class="form-control input-sm" />
                        </td>
                    </tr>--%>
                </table>
            </form>
        </div>
    </div>
</div>



<script src="<%=URL_STATIC%>static/plugin/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script type="text/javascript">
    jo.formatUI();//格式化jo组件
</script>
</body>
</html>
